from selenium.webdriver.common.by import By
import time
from base import Base
class Page(Base):
    djzhuce_loc=(By.XPATH,'//*[@id="app"]/div/section/aside/ul/li/ul/li[3]/a')
    def djzhuce(self):
        self.click(self.djzhuce_loc)

    username_loc=(By.CLASS_NAME,'el-input__inner')
    def username(self):
        self.send_keys(self.username_loc,'admin')

    password_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div/div/input')
    def password(self):
        self.send_keys(self.password_loc,'123456')

    tijiao_lic=(By.XPATH,'//*[@id="app"]/div/section/section/main/form/div[4]/div/button[1]/span')
    def tijiao(self):
        self.click(self.tijiao_lic)

    djpost1_loc=(By.XPATH,'//*[@id="app"]/div/section/aside/ul/li/ul/li[5]/a')
    def djpost1(self):
        self.click(self.djpost1_loc)
    djpost2_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[2]/span')
    def djpost2(self):
        self.click(self.djpost2_loc)
    shuru1_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div/div/input')
    def shuru1(self):
        self.send_keys(self.shuru1_loc,'烦恼')
    shuru2_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div/textarea')
    def shuru2(self):
        self.send_keys(self.shuru2_loc,'发能i很烦恼就差你SVN参考看到没讷河小马达饭卡')
    shuru3_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/input')
    def shuru3(self):
        self.send_keys(self.shuru3_loc,'1')
    shuru4_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/div/div/input')
    def shuru4(self):
        self.send_keys(self.shuru4_loc,'1')
    shuru5_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[5]/div/div/div/input')
    def shuru5(self):
        self.send_keys(self.shuru5_loc,'2025-07-07 12:08:09')
    tijiao2_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[6]/div/button[1]')
    def tijiao2(self):
        self.click(self.tijiao2_loc)


    def test_zhuce(self):
        self.open_url('http://localhost:8080/')
        time.sleep(2)
        self.djzhuce()
        time.sleep(2)
        self.username()
        time.sleep(2)
        self.password()
        time.sleep(2)
        self.tijiao()
        time.sleep(2)
        self.djpost1()
        time.sleep(2)
        self.djpost2()
        time.sleep(2)
        self.shuru1()
        time.sleep(2)
        self.shuru2()
        time.sleep(2)
        self.shuru3()
        time.sleep(2)
        self.shuru4()
        time.sleep(2)
        self.shuru5()
        time.sleep(2)
        self.tijiao2()
        time.sleep(5)

